﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Kiiro.Common.Interfaces
{
    public interface IPermissions
    {
        /// <summary>
        /// Setup: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsSetup { get; set; }

        /// <summary>
        /// Users: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsUsers { get; set; }

        /// <summary>
        /// Projects: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsProjects { get; set; }

        /// <summary>
        /// Activity: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsActivity { get; set; }

        /// <summary>
        /// Teams: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsTeams { get; set; }

        /// <summary>
        /// Work: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsWork { get; set; }

        /// <summary>
        /// Discussions: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsDiscussions { get; set; }

        /// <summary>
        /// Documents: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsDocuments { get; set; }

        /// <summary>
        /// Lists: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsLists { get; set; }

        /// <summary>
        /// Project Plan File: C = 0, R = 1, U = 2, D = 3
        /// </summary>
        List<bool> PermissionBitsProjectPlanFile { get; set; }

        /// <summary>
        /// Error messages associated with Permsissions validation
        /// </summary>
        List<string> PermissionErrorMessages { get; set; }

        /// <summary>
        /// Is the License Key Valid?
        /// </summary>
        bool LicenseKeyIsValid { get; set; }

        /// <summary>
        /// License Key: Key Expired = 0, Portal Limit = 1, User Limit = 2, Project Limit = 3
        /// </summary>
        List<bool> LicenseKeyBits { get; set; }

        /// <summary>
        /// Error Messages associated with validation the License Key
        /// </summary>
        List<string> LicenseKeyErrorMessages { get; }

        /// <summary>
        /// Constructor Method that sets all the PermissionBits
        /// </summary>
        void GetPermissionBitsForPage ( );

        /// <summary>
        /// Are PermissionBits already set?
        /// </summary>
        bool DoesPageHavePermissionsSet { get; }


        // Special Case Helpers

        /// <summary>
        /// User Id of User being viewed (base.ItemId)
        /// </summary>
        int UserId { get; }

        /// <summary>
        /// Discussion Author's Midori Id
        /// </summary>
        int AuthorId { get; set; }

        // Special Cases

        /// <summary>
        /// Can the Current User Update the User being Displayed?
        /// </summary>
        bool CanUserUpdateThemselves { get; set; }

        /// <summary>
        /// Can Team Member Update Work (checks if from Project Plan)?
        /// </summary>
        bool CanTeamMemberUpdateWork { get; set; }

        /// <summary>
        /// Can a Team Member/Project Manager Update/Delete Discussion?
        /// </summary>
        bool CanTeamMemberUpdateDiscussion { get; set; }
    }
}

/*************************************************************************
 * 
 * $Log: /Internal Projects/Kiiro/Kiiro.Common/Interfaces/IPermissions.cs $
 * 
 * 3     17/08/09 10:38a Camerons
 * Added check-in comments section
 * 
 ************************************************************************/